<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/newbase.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>佣金明细</title>
    {include file='public/href' /}
    <script>
        $(function () {
            $(".show").click(
                function () {
                    $(".show_list").show();
                }
            )
            $(".show_list li").click(
                function () {
                    var t=$(this).text();
                    $(this).parent("ul").hide();
                    $(".show").text(t);
                }
            )
        })

    </script>
</head>
<body>
<div class="wrap-mx">
    <div class="header">
        <p>佣金明细</p>
        <img src="__STATIC__/img/back.png" class="back" onclick=window.location.href="{:url('mobile/user_info/brokerage_index')}">
        <div style="width: 80px;text-align: center;position: absolute;top:50%;font-size: 12px;line-height: 20px;margin-top: -10px;right:0;">
            {eq name=":input('type')" value="1"}
            <div class="show">收入</div>
            {else/}
            <div class="show">支出</div>
            {/eq}
            <ul class="show_list" style="display: none;">
                <li onclick='window.location.href="{:url('user_info/brokerage_details',['type'=>1])}?"'>收入</li>
                <li onclick='window.location.href="{:url('user_info/brokerage_details',['type'=>2])}?"'>支出</li>
            </ul>
        </div>
    </div>
    <ul class="list1">
    </ul>
</div>
{include file='public/src' /}
<script src="__STATIC__/js/layui/layui.js"></script>
<script>
    //layer流加载
    layui.use('flow', function() {
        var $ = layui.jquery;
        var flow = layui.flow;

        flow.load({
            elem: '.list1' //流加载容器
            ,isAuto:true
            ,isLazyimg:true
            ,done: function(page, next){ //执行下一页的回调
                var lis = [];
                $.ajax({
                    url:"{:url('mobile/user_info/brokerage_details')}",
                    dataType:'json',
                    type:'post',
                    data:{'page':page,'type':"{:input('type')}"},
                    success:function(t){
                        layui.each(t.data, function(index, item){
                            if (item.brokerage!=0) {
                                lis.push(
                                    '<li><a><p>'+item.title+'<br><span>' +
                                    ''+item.create_time+'</span></p>'+
                                    '<span>'+item.brokerage+'</span></a></li>'
                                );
                            }

                        });
                        next(lis.join(''), page < t.pages);
                    },
                    error: function () {
                        layer.open({content:'网络繁忙,请重试',skin:'msg',time:2});
                    }
                })
            }
        });
    });
</script>
</body>
</html>